package com.member.shop.service.impl;

import java.util.Arrays;
import java.util.List;

import com.member.common.utils.DateUtils;

import javax.annotation.Resource;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.springframework.stereotype.Service;
import com.member.shop.mapper.SysBizGoodsBrowseMapper;
import com.member.shop.domain.SysBizGoodsBrowse;
import com.member.shop.service.ISysBizGoodsBrowseService;

/**
 * 商品浏览统计Service业务层处理
 *
 * @author lixinchen
 * @date 2025-01-11
 */
@Service
public class SysBizGoodsBrowseServiceImpl extends ServiceImpl<SysBizGoodsBrowseMapper, SysBizGoodsBrowse> implements ISysBizGoodsBrowseService {
    @Resource
    private SysBizGoodsBrowseMapper sysBizGoodsBrowseMapper;

    /**
     * 查询商品浏览统计
     *
     * @param id 商品浏览统计主键
     * @return 商品浏览统计
     */
    @Override
    public SysBizGoodsBrowse selectSysBizGoodsBrowseById(Long id) {
        return sysBizGoodsBrowseMapper.selectById(id);
    }

    /**
     * 查询商品浏览统计列表
     *
     * @param queryWrapper 商品浏览统计
     * @return 商品浏览统计
     */
    @Override
    public List<SysBizGoodsBrowse> selectSysBizGoodsBrowseList(LambdaQueryWrapper<SysBizGoodsBrowse> queryWrapper) {
        return sysBizGoodsBrowseMapper.selectList(queryWrapper);
    }

    @Override
    public List<SysBizGoodsBrowse> selectSysBizGoodsBrowseList(SysBizGoodsBrowse sysBizGoodsBrowse) {
        return sysBizGoodsBrowseMapper.selectSysBizGoodsBrowseList(sysBizGoodsBrowse);
    }

    /**
     * 新增商品浏览统计
     *
     * @param sysBizGoodsBrowse 商品浏览统计
     * @return 结果
     */
    @Override
    public int insertSysBizGoodsBrowse(SysBizGoodsBrowse sysBizGoodsBrowse) {
        sysBizGoodsBrowse.setCreateTime(DateUtils.getNowDate());
        return sysBizGoodsBrowseMapper.insert(sysBizGoodsBrowse);
    }

    /**
     * 修改商品浏览统计
     *
     * @param sysBizGoodsBrowse 商品浏览统计
     * @return 结果
     */
    @Override
    public int updateSysBizGoodsBrowse(SysBizGoodsBrowse sysBizGoodsBrowse) {
        sysBizGoodsBrowse.setUpdateTime(DateUtils.getNowDate());
        return sysBizGoodsBrowseMapper.updateById(sysBizGoodsBrowse);
    }

    /**
     * 批量删除商品浏览统计
     *
     * @param ids 需要删除的商品浏览统计主键
     * @return 结果
     */
    @Override
    public int deleteSysBizGoodsBrowseByIds(Long[] ids) {
        return sysBizGoodsBrowseMapper.deleteBatchIds(Arrays.asList(ids));
    }

    /**
     * 删除商品浏览统计信息
     *
     * @param id 商品浏览统计主键
     * @return 结果
     */
    @Override
    public int deleteSysBizGoodsBrowseById(Long id) {
        return sysBizGoodsBrowseMapper.deleteById(id);
    }
}
